
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;

namespace Swaf
{
	/// <summary>
	/// Summary description for IDecorator.
	/// </summary>
	public interface IDecorator
	{
		string Name{get;}
		string Value{get;}
		/// <summary>
		/// Indicates wether the implementation acts as a standin to the item being
		/// decorated or if the item is to be exposed directly under standard operations.
		/// </summary>
		/// <remarks>The specific meaning of this method is dependent on the element supporting
		/// the decorator pattern.  See the specific decorator implemenation such as <c>BizRule.RuleManager</c>
		/// or <c>BizObj.BizObjManager</c>.</remarks>
		bool IsStandin{get;}
		/// <summary>
		/// Given the item being decorated, this gives the decorator a change to decorate the instance in some way.
		/// </summary>
		/// <remarks>For a simple decorator that does not <c>Standin</c>, this method should just return the
		/// same object passed in <c>theInst</c>.  However, if this decorator returns <c>true</c> from <c>IsStandin</c>
		/// this it should return a new object that "wraps" the object in <c>theInst</c>.  The specific way in which this
		/// needs to be done is defined by the specific implemenation of the decorator pattern.</remarks>
		/// <param name="theInst">The instance to be decorated</param>
		/// <returns>The item after being decorated.  This may be the same object as <c>theInst</c>, but may be
		/// a new object.</returns>
		object decorateInstance(object theInst);
	}
}
